﻿using DAMS.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DAMS.Web.Areas.Manage.Models
{
    public class ArticleCreateViewModel
    {
        /// <summary>
        /// 文章标题
        /// </summary>
        [Display(Name ="标题")]
        [StringLength(60,ErrorMessage ="标题最大长度60个字符")]
        [Required(ErrorMessage ="请输入内容标题")]
        public string Title { get; set; }
        /// <summary>
        /// 分类ID
        /// </summary>

        [Display(Name = "分类")]
        [Required(ErrorMessage = "请选择分类")]
        [Range(1, 1000000, ErrorMessage = "请选择分类")]
        public int CategoryID { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        [Display(Name = "作者")]
        [StringLength(7, ErrorMessage = "最大长度7个字符")]
        public string Auth { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        [Display(Name = "内容")]
        public string Content { get; set; }
        /// <summary>
        /// 摘要
        /// </summary>
        [Display(Name = "摘要")]
        [StringLength(60, ErrorMessage = "标题最大长度60个字符")]
        public string Excerpt { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        [Display(Name = "发布时间")]
        [Required]
        public DateTime PublishTime { get; set; }
        /// <summary>
        /// 是否置顶
        /// </summary>
        [Display(Name = "置顶")]
        public bool isTop { get; set; }
        /// <summary>
        /// 发布
        /// </summary>
        [Display(Name = "发布")]
        public bool isPublish { get; set; }

        /// <summary>
        /// 是否轮播
        /// </summary>
        [Display(Name = "是否轮播")]
        public bool isCarousel { get; set; }
        /// <summary>
        /// 轮播图地址
        /// </summary>
        [Display(Name = "轮播图片")]
        public string CarouselPath { get; set; }

        /// <summary>
        /// 封面图片
        /// </summary>
        [Display(Name = "封面图片")]
        [Required(ErrorMessage = "请选择封面图片")]
        public string CoverPath { get; set; }

        /// <summary>
        /// 目录Tree json
        /// </summary>
        public string TreeJson { get; set; }

        /// <summary>
        /// 系统设置
        /// </summary>
        public SiteConfig Config { get; set; }
    }
}
